import Vue from 'vue'
import App from './App.vue'
import ElementUI from 'element-ui';
import 'element-ui/lib/theme-chalk/index.css';
import store from'./store'
import router from './router/index'
import Axios from 'axios'
import Composition from '@vue/composition-api'

Vue.config.productionTip = false

Vue.use(ElementUI)
Vue.use(Composition)
new Vue({
  render: h => h(App),
  store,router
}).$mount('#app')




// Axios.interceptors.request.use(
//   config => {
//     if (localStorage.getItem("TOKEN")) {  // 判断是否存在token，如果存在的话，则每个http header都加上token
//       config.headers['TOKEN'] =localStorage.getItem("TOKEN")
//       console.log("token用啦");
//     }
//     console.log("没用");
//     return config;
//   },
//   err => {
//     console.log("有问题");
//     return Promise.reject(err);
//   });

// Axios.defaults.headers.common["TOKEN"] = localStorage.getItem("TOKEN")
// console.log("test"+localStorage.getItem("TOKEN"));

